Small script problem

Having trouble with this one script, got it down to a single error.
 

Item currItem
Module m
 
For currItem in current Folder do{
                m = write(fullName(currItem))
}

 


This opens the current item (a formal module) so that I can write new data into it. The compiler gives me an error along the lines of "wrong use of the = operator." In the previous script, I did something nearly identical, using the read() function so that I could extract the attributes and types. It doesn't seem to be working here and I'd like to know why.

 


Morrie - Fri Aug 05 13:04:38 EDT 2011

Re: Small script problem
llandale - Fri Aug 05 13:46:58 EDT 2011

You "edit" or "share" or "read" a module, not "write" it.

You should add this:
if (type(currItem) != "Formal") continue
to make sure you don't try to edit a folder.

You probably want to open it invisibly; probably want to load the standard view; and if the module is already locked you probably don't want the script to stop and ask you want to do. If so, do this:
m = edit(fullName(currItem), false, true, true) // invisible, Silent, loadStandardView

  • Louie